package com.dhc.quartz;

import org.quartz.*;
import org.quartz.JobListener;

public class TriggerListenerActive implements TriggerListener {

    @Override
    public String getName() {
        String simpleName = this.getClass().getSimpleName();
        return simpleName;
    }

    @Override
    public void triggerFired(Trigger trigger, JobExecutionContext jobExecutionContext) {
        System.out.println("触发器被触发");
    }

    @Override
    public boolean vetoJobExecution(Trigger trigger, JobExecutionContext jobExecutionContext) {
        System.out.println("没有被触发");
        return false;//true表示不会执行job的方法
    }

    @Override
    public void triggerMisfired(Trigger trigger) {
        System.out.println("错过触发");
    }

    @Override
    public void triggerComplete(Trigger trigger, JobExecutionContext jobExecutionContext, Trigger.CompletedExecutionInstruction completedExecutionInstruction) {
        System.out.println("完成之后触发");
    }
}
